home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Run Magazine ReRun 1985 Fall
/
rerun-1985-fall.d64
/
test taker
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
2KB
|
75 lines
10 poke53280,1:poke53281,1:poke646,2
20 ll=22:ifpeek(44)=8thenll=40
40 p1=ll/2-6:printchr$(14):p2=p1+ll+3
50 print"[147]"tab(ll*5.5-5)"[209][213][197][211][212][201][207][206][211]![145][145][145][157][157][157][157][157][157][157][157][157][157][157][157]";
52 fori=1to15:print"*";:gosub1300:next:fori=1to10:print"[157]*";:gosub1300:next
54 fori=1to15:print"[157][157]*";:gosub1300:next:fori=1to10:print"[157][145]*";:gosub1300:next
56 print"a self-test[157][157][157][157][157][157][157][157][157]program":gosub1200:gosub1200
90 gosub505
100 print"[147]"tab(p1)"*** [205][197][206][213][146] ***":printtab(p1)"[157][212][146]est
105 [153][163]p1)"cmdstr$waitrill":[153][163]p1)"cmd(NULL)waitoad new program
107 printtab(p1)"[157][211]elect one
110 [141]1000
112 [139]x$[178]"d"[167][141]200:[137]100
114 [139]x$[178]"t"[167][141]300:[137]100
116 [139]x$[178]"l"[167][141]500:[137]100
120 [137]110
199 [143] drill subroutine
200 wr[178]0:s[178]n:[129]i[178]1[164]n:rn%(i)[178]i:[130]
205 rd[178][181]([187](x)[172]s)[170]1:f[178]0:r[178]rn%(rd)
215 [153]"load#"r[163]ll[171]10)"wait(NULL)o go"s:[153][163]ll[171]10)"(NULL)rong"wr
220 [153][163]p2)"str$(NULL)right$(NULL)(NULL)":[153]q$(r,1):[153]""
225 [141]400:[139]an$[178]"\"[167][142]
230 [139]an$[178]""[167]255
235 [139]c[178]1[175]f[178]0[167][141]1100:[129]i[178]rd[164]s:rn%(i)[178]rn%(i[170]1):[130]:s[178]s[171]1:[137]260
240 [139]c[178]1[167][141]1100:[137]260
245 [139]f[178]0[167]f[178]1:[153]"(NULL)rong -":[153]"(NULL)ry again":wr[178]wr[170]1:[137]247
246 [137]250
247 [141]1200:[137]215
250 [153]"(NULL)rong again -
255 gosub485
260 ifs>0then205
295 print"[147]"tab(p1+3)"[196][210][201][204][204]":print"[212]he drill had a total of "n"questions."
296 printtab(p1)"[215]rong:"wr"":gosub1400:return
299 rem test subroutine
300 wr=0:rt=0:r=1
310 print"[147]#"rtab(ll-10)"[146][210]ight"rt:printtab(ll-10)"[215]rong"wr
320 printtab(p2)"[212][197][211][212]":printq$(r,1)""
325 gosub400:ifan$="\"thenreturn
330 ifc=1thengosub1100:rt=rt+1:goto340
335 wr=wr+1:gosub480
340 ifr<nthenr=r+1:goto310
345 print"[147]"tab(p1+3)"[212][197][211][212]":print"[212]he test had a total of"n" questions."
350 printtab(p1)"[157][212]otal right:"rt:printtab(p1)"[157][212]otal wrong:"wr
355 printtab(p1-3)"[212]his is"int(rt/n*100)"% right"
360 d=int((rt/n-.5)*13.9):ifd<1thend=1
365 restore:fori=1tod:readf$:next:printtab(p1+ll)f$"!":gosub1400:return
380 data"[212][197][210][210][201][194][204][197]","[206][207][212] [199][207][207][196]","[193][214][197][210][193][199][197]","[214][197][210][217][160][199][207][207][196]","[197][216][195][197][204][204][197][206][212]","[207][213][212][211][212][193][206][196][201][206][199]"
400 poke198,0:an$="":inputan$:le=len(q$(r,2))
410 k=le+1:fori=1tole:ifmid$(q$(r,2),i,1)="\"thenk=i:i=le
430 next:c=0:ifleft$(an$,k-1)=left$(q$(r,2),k-1)thenc=1
440 return
480 printtab(p1)"[215]rong -"
485 print"[195]orrect answer is":printleft$(q$(r,2),k-1)" "mid$(q$(r,2),k+1)
486 gosub1400:return
499 rem load subroutine
500 print"[147][204]oad new program.":print"[193]re you sure? ([217]/[206])":gosub1000
502 ifx$<>"y"thenreturn
505 print"[147]"tab(p1)"*** [204][207][193][196][146] ***
510 [153]"program name":[133]nf$
520 [153]"right$nsert question file disk. (NULL)ress any keywhen ready":[141]1000
530 [159]2,8,2,"0:"[170]nf$[170]",s,r"
540 [132]2,n
550 [151]49,[194](47):[151]50,[194](48):[134]q$(n,2):[134]rn%(n[170]1):n[178]1
560 [132]2,q$(n,1),q$(n,2):[139]st[178]0[167]n[178]n[170]1:[137]560
570 [160]2:[153]"ascile "nf$:[153]"loaded with"n:[153]"entries":[141]1400
575 [142]
999 [143] miscellaneous subroutines
1000 [151]198,0
1001 [161]x$:[139]x$[178]""[167]1001
1010 [142]
1100 [153][163]p1)"** len(NULL)(NULL)(NULL)vallen(NULL) **
1200 fort=1to1000:next:return
1300 forl=1to30:next:return
1400 printtab(p1)"[208]ress any key.":goto1000